﻿using System;

namespace NiuX.Utils.SimpleTaskScheduler;

public static class TaskScheduler
{
    private static readonly SchedulerService Scheduler = SchedulerService.Instance;

    public static void IntervalInSeconds(int hour, int sec, double interval, Action task)
    {
        interval /= 3600;
        Scheduler.ScheduleTask(hour, sec, interval, task);
    }

    public static void IntervalInMinutes(int hour, int min, double interval, Action task)
    {
        interval /= 60;
        Scheduler.ScheduleTask(hour, min, interval, task);
    }

    public static void IntervalInHours(int hour, int min, double interval, Action task)
    {
        Scheduler.ScheduleTask(hour, min, interval, task);
    }

    public static void IntervalInDays(int hour, int min, double interval, Action task)
    {
        interval *= 24;
        Scheduler.ScheduleTask(hour, min, interval, task);
    }
}